# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models


# Create your models here.
# 从txt文本文件导入数据模型
# 详情参见txt2db.py
class Blog(models.Model):
    title = models.CharField(max_length=100)
    content = models.TextField()

    def __unicode__(self):
        return self.title


# 从json文件导入数据模型
# 使用命令python manage.py loaddata fixture.json
class Person(models.Model):
    first_name = models.CharField(max_length=100)
    last_name = models.CharField(max_length=100)

    def __unicode__(self):
        return self.first_name + " " + self.last_name
